<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		
	</head>
	<body>
		<div id="clock">
			
		</div>
		<script type="text/javascript">
			function time_12h(){
			var day=new Date();
			var time=null;
			var hh=day.getHours();
			var mm=day.getMinutes();
			var ss=day.getSeconds();
			if(hh>12){
				hh=hh-12;
				time="PM";
			}else{
				time="AM";
			}
			var xq=day.getDay();
			switch(xq){
				case 0:
				xq="星期日";
				break ;
				case 1:
				xq="星期一";
				break ;
				case 2:
				xq="星期二";
				break ;
				case 3:
				xq="星期三";
				break ;
				case 4:
				xq="星期四";
				break ;
				case 5:
				xq="星期五";
				break ;
				case 6:
				xq="星期六";
				break ;
			}
			document.getElementById("clock").innerHTML="你好，欢迎访问鬼魅商城"+"<br />"+
			day.getFullYear()+"年"+(day.getMonth()+1)+"月"+day.getDate()+"日"+"&nbsp&nbsp&nbsp"
			+hh+":"+mm+":"+ss+"&nbsp&nbsp&nbsp"+time+"&nbsp&nbsp&nbsp"+xq;
		}	
			var time=setInterval("time_12h()",1000);
		</script>
	</body>
</html>
